<template>
  <div class="swiper">
    <div class="swiper-wrapper">
      <slot></slot>
    </div>

    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>
  </div>
</template>

<script>
// 使用swiper/bundle导入全部swiper捆绑包，即全部的swiper功能，否则，你就需要按需导入各个功能譬如分页器等等
import Swiper from 'swiper/bundle'
import 'swiper/swiper-bundle.css'

export default {
  mounted () {
    new Swiper('.swiper', {
      // direction: 'vertical', // 垂直切换选项
      loop: true, // 循环模式选项

      autoplay: {
        delay: 2500,
        disableOnInteraction: false // 交互后是否继续循环
      },

      // 如果需要分页器
      pagination: {
        el: '.swiper-pagination'
      }

    })
  }
}
</script>

<style lang="scss" scoped>

</style>
